package com.code.AZPlan.service.schedule;

import com.code.AZPlan.api.AZPlanStaticIncomeService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 产生静态收益的定时任务
 *
 * @author tangyifei
 * @since 2020年1月2日19:01:16
 */
@Component
public class AZPlanStaticIncomeSchedule {

    @Resource
    private AZPlanStaticIncomeService azPlanStaticIncomeService;

    /**
     * 每天凌晨3点产生静态收益
     */
    @Scheduled(cron = "0 0 3 * * ?")
//    @Scheduled(cron = "0 0/30 * * * ?")
    @Async
    public void generateStaticIncome() {
        azPlanStaticIncomeService.generateStaticIncome();
    }


}
